package com.luoc.spring;

import com.luoc.spring.entity.User;
import com.luoc.spring.factoryBean.Car;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author luoc
 * @version 1.0
 * @date 2021/1/8 11:45
 * @since 1.0
 */
public class test {

   // String name;
    public static void main(String[] args) {
         BeanFactory bf = new XmlBeanFactory(new ClassPathResource("beanFactoryTest.xml"));
//       ConfigurableListableBeanFactory bf = new XmlBeanFactory(new ClassPathResource("beanFactoryTest.xml"));
//       BeanFactoryPostProcessor bfpp = (BeanFactoryPostProcessor) bf.getBean("bfpp");
//       bfpp.postProcessBeanFactory(bf);

        //ConcurrentHashMap
//        Car car = (Car) bf.getBean("car");
//        System.out.println(car.getBrand());
      //System.out.println(user.getBirthDay());

    }

    @SuppressWarnings("unchecked")
    public void getName(){
        List b = new ArrayList<>();
        b.add("a");
    }


    public List getList() {
        return new ArrayList(2);
    }
}
